<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>title</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../css/common.css"/>
    <link rel="stylesheet" type="text/css" href="../css/my-groups.css"/>
</head>
<body>
	<div id="wrap">
        <div id="main">
        		
        		<div class="run-group-lists-empty hide" id="my-groups-list-empty">
        			<div class="empty-header">暂无跑团数据...</div>
        			<div class="empty-btn btn-empty-apply" onclick="openSearch()">前往加团</div>
        			<div class="empty-btn btn-empty-create" onclick="openGroupCreate()">前往创团</div>
        		</div>
        		
        		<div class="run-group-lists hide" id="my-groups-list">
        				
        				<div class="run-group-item" onclick="openGroupDetail('{{=it[i].id}}');">
                            <div class="run-group-item-left" style="background-image:url(../image/checkin1.png )"></div>
                            <div class="run-group-item-right">
                            		<div class="run-group-item-title">超级马拉松小分队</div>
                            		<div class="run-group-item-info">
                            			<span class="run-group-item-label">互联网</span>
                            			<span class="run-group-item-num">123人</span>
                            			<span class="run-group-item-location"><img src="../image/local.png" />宝安中心</span>
                            		</div>
                            		<div class="run-group-item-desc">
                                		跑团宣言：奔跑团欢迎各种帅哥美女...
                            		</div>
                            </div>
                    </div>
                    
                    <div class="run-group-item" onclick="openGroupDetail('{{=it[i].id}}');">
                            <div class="run-group-item-left" style="background-image:url(../image/checkin1.png )"></div>
                            <div class="run-group-item-right">
                            		<div class="run-group-item-title">超级马拉松小分队</div>
                            		<div class="run-group-item-info">
                            			<span class="run-group-item-label">互联网</span>
                            			<span class="run-group-item-num">123人</span>
                            			<span class="run-group-item-location"><img src="../image/local.png" />宝安中心</span>
                            		</div>
                            		<div class="run-group-item-desc">
                                		跑团宣言：奔跑团欢迎各种帅哥美女...
                            		</div>
                            </div>
                    </div>
                    
                    <div class="run-group-item" onclick="openGroupDetail('{{=it[i].id}}');">
                            <div class="run-group-item-left" style="background-image:url(../image/checkin1.png )"></div>
                            <div class="run-group-item-right">
                            		<div class="run-group-item-title">超级马拉松小分队</div>
                            		<div class="run-group-item-info">
                            			<span class="run-group-item-label">互联网</span>
                            			<span class="run-group-item-num">123人</span>
                            			<span class="run-group-item-location"><img src="../image/local.png" />宝安中心</span>
                            		</div>
                            		<div class="run-group-item-desc">
                                		跑团宣言：奔跑团欢迎各种帅哥美女...
                            		</div>
                            </div>
                    </div>
                    
        		</div>
        		
        </div>
    </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/common.js"></script>

<script type="text/javascript">
	apiready = function(){
		initMyGroups();
	};
	
	function initMyGroups() {
		
		var url_get_my_groups = 'user-groups';
		
		ajaxRequest(url_get_my_groups, 'GET', '', function(ret, err) {
		
			if (ret) {
			
				if (ret.length > 0) {
					$api.removeCls($api.byId('my-groups-list'), 'hide');
				} else {
					$api.removeCls($api.byId('my-groups-list-empty'), 'hide');
				}
			
			} else {
				api.alert({
                		msg: err.msg
            		});
			}
		
		});
		
	}
	
	function openSearch() {
		api.openWin({
	        name: 'discovery',
	        url: 'discovery/discovery.html'
	    });
	}
	
	function openGroupCreate() {
		api.openWin({
	        name: 'group-create-tags',
	        url: 'group-create-tags/group-create-tags.html'
	    });
	}
</script>
</html>